package phoenix.web.test_objects.data_providers;

import org.testng.TestNGException;

import phoenix.core.PhoenixManager;
import phoenix.core.base.extensions.TestBaseExt;
import phoenix.core.data_models.TestUserDataModel;

/**
 * Class contains test data for login form
 */
public class ActivityDataProviders extends TestBaseExt
{

	public ActivityDataProviders(PhoenixManager p_phoenix)
	{
		super(p_phoenix);
	}

	public Object[][] recepientData()
	{

		TestUserDataModel p_recipient;
		Integer membership_ID = manager.testUser().defineMembershipStatus("female");

		if (manager.isMD())
		{
			p_recipient = db().getUser("39e8659b7af611e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			p_recipient = db().getUser("8970694886be11e49ef5441ea14ed80c");
		}
		else
		{
			p_recipient = db().getUserBy(testModel().getSiteName(), membership_ID, "female");
		}

		return new Object[][]
		{
				{ p_recipient },
		};
	}

	public Object[][] recepientDataCountersBrowse()
	{
		TestUserDataModel recipientMaleBrowse;

		if (manager.isMD())
		{
			recipientMaleBrowse = db().getUser("eb65b5fb797011e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			recipientMaleBrowse = db().getUser("6b2ee67b853a11e49ef5441ea14ed80c");
		}
		else
		{
			recipientMaleBrowse = db().getUserBy(testModel().getSiteName(), 2, "male", "3000");
		}

		if (recipientMaleBrowse == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}
		return new Object[][]
		{
				{ recipientMaleBrowse },
		};
	}

	public Object[][] recepientDataCountersWink()
	{
		TestUserDataModel recipientMaleWink;

		if (manager.isMD())
		{
			recipientMaleWink = db().getUser("00a7a847797a11e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			recipientMaleWink = db().getUser("b0be16b1853a11e49ef5441ea14ed80c");
		}
		else
		{
			recipientMaleWink = db().getUserBy(testModel().getSiteName(), 3, "male", "2500");
		}

		if (recipientMaleWink == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}

		return new Object[][]
		{
				{ recipientMaleWink },
		};
	}

	public Object[][] recepientDataCountersMessage()
	{
		TestUserDataModel recepientMaleMessage;

		if (manager.isMD())
		{
			recepientMaleMessage = db().getUser("bf1ddcb3797a11e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			recepientMaleMessage = db().getUser("f92129f2853a11e49ef5441ea14ed80c");
		}
		else
		{
			recepientMaleMessage = db().getUserBy(testModel().getSiteName(), 2, "male", "2000");
		}

		if (recepientMaleMessage == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}

		return new Object[][]
		{
				{ recepientMaleMessage },
		};
	}

	public Object[][] notificationBrowseData()
	{
		TestUserDataModel p_user;

		if (manager.isMD())
		{
			p_user = db().getUser("eb65b5fb797011e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			p_user = db().getUser("50e5d60f860d11e49ef5441ea14ed80c");
		}
		else
		{
			p_user = db().getUserBy(testModel().getSiteName(), 1, "male", "2000");
		}

		if (p_user == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}

		return new Object[][]
		{
				{ p_user },
		};
	}

	public Object[][] notificationWinkData()
	{
		TestUserDataModel p_user;

		if (manager.isMD())
		{
			p_user = db().getUser("eb65b5fb797011e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			p_user = db().getUser("b241893c860d11e49ef5441ea14ed80c");
		}
		else
		{
			p_user = db().getUserBy(testModel().getSiteName(), 1, "male", "5000");
		}

		if (p_user == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}
		return new Object[][]
		{
				{ p_user },
		};
	}

	public Object[][] notificationMessageData()
	{
		TestUserDataModel p_user;

		if (manager.isMD())
		{
			p_user = db().getUser("00a7a847797a11e49ef5441ea14ed80c");
		}
		if (manager.isNF())
		{
			p_user = db().getUser("f91c160e860d11e49ef5441ea14ed80c");
		}
		else
		{
			p_user = db().getUserBy(testModel().getSiteName(), 4, "male", "2000");
		}

		if (p_user == null)
		{
			throw new TestNGException("Unable to load users in data provider");
		}

		return new Object[][]
		{
				{ p_user },
		};
	}

}
